package cn.y.operation.framework.constants;

import org.springframework.stereotype.Component;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * @ClassName: Constants
 * @author: 叶子豪
 * @create: 2020-09-08 13:41
 */
@Component
public class Constants {
    /********************************** 字符编码 *****************************/
    public static final String UTF8 = StandardCharsets.UTF_8.toString();

    public static final Charset CharsetUTF8 = StandardCharsets.UTF_8;

    public static final String GBK = "GBK";

    public static final String ISO88591 = "ISO-8859-1";

    /**
     * 验证码Session KEY
     */
    public static final String KAPTCHA_SESSION_KEY = com.google.code.kaptcha.Constants.KAPTCHA_SESSION_KEY;

    /******************************* 输出网页数据格式 ***************************/
    public static final String HTML = "text/html";

    public static final String JSON = "application/json";

    public static final String SCRIPT = "text/javascript";

    public static final String HTTP_METHOD_GET = "GET";

    public static final String HTTP_METHOD_PUT = "PUT";

    public static final String HTTP_METHOD_DELETE = "DELETE";

    /**
     * 返回URL
     */
    public static final String RETURN_URL = "returnUrl";

    /********************************** 系统会话 ********************************/
    public static final String SESSION_USER = "SESSION_USER";

    public static final String ERROR_MESSAGE = "ERROR_MESSAGE";

    public static final String MANAGE_I18N_CONTEXT_NAME = "manageI18nContext";

    public static final String MANAGE_I18N_LANG = "lang";

    public static final String BASE_PATH = "basePath";

    public static final String UPLOAD_SERVER = "uploadServer";

    public static final int DEFAULT_EXPIRE_TIME = 5 * 60;//5分钟

    /**
     * 登录3次加入校验码
     */
    public static final int LOGIN_TRY_TIME = 3;

    public static final String LOGIN_USERNAME = "LoginUsername";//登录用户名

    /********************************** 通用常量 ********************************/

    public static final String YYYY_MM_DDHHMMSS = "yyyy-MM-dd HH:mm:ss";

    public static final String YYYY_MM_DDHHMM = "yyyy-MM-dd HH:mm";

    public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";

    public static final String YYYYMMDDHHMM = "yyyyMMddHHmm";

    public static final String YYYYMMDD = "yyyyMMdd";

    public static final String DEFAULT_SPLIT_CHAR = ",";

    /********************************** 配置、模板文件名 ********************************/
    public static final String SYSTEM_CONFIG_FILE_PATH = "classpath:config.properties";

    public static final String LOCALHOST_FILE_PATH = "/";

    public static final String FILE_PATH = "/UpLoadFiles/";

    //********************************** 数据库属性 ********************************/

    //********************************** 分页配置 ********************************/
    /**
     * 当前记录起始索引
     */
    public static final String PAGE_NUM = "page";

    /**
     * 每页显示记录数
     */
    public static final String PAGE_SIZE = "limit";

    /**
     * 排序列
     */
    public static final String ORDER_BY_COLUMN = "orderByColumn";

    /**
     * 排序的方向 "desc" 或者 "asc".
     */
    public static final String IS_ASC = "isAsc";

    /********************************** --- ********************************/
    public static final String REDIS_PREFIX_IMPORT_STATUS = "ImportStatus:";
    public static final String REDIS_PREFIX_EXPORT_STATUS = "ExportStatus:";
    public static final String REDIS_PREFIX_RECALCULATION_STATUS = "Recalculation:";
    public static final int REDIS_IMPORT_STATUS_TIME = 30;
    public static final String EXCEL_TEMPLATE_PATH = "classpath:poi/excel/";
    public static final String EXCEL_TEMPLATE_EXTEND = ".xlsx";
    public static final String EXCEL_ATTENDANCE_RECORD = "InvestigationRecord";
    /********************************** --- ********************************/
    public static final String PASSKEY = "#4@Y$6";
    public static final int QRCodeWidth = 500;
    public static final int QRCodeHeight = 500;

    public static final String COMPANY = "antlia";

}
